package com.youu.youu.portal.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ControllerTest {
    
    @RequestMapping("toUserMain")
    public String toMain(HttpSession session){
    	System.out.println("开发用直接去个人中心");
    	Object attribute = session.getAttribute("tUser");
    	System.out.println(attribute);
    	if(attribute!=null){
    		return "main";
    	}
    	session.setAttribute("error", "请先登录！");
    	return "redirect:/login.jsp";
    }
    
}
